<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no, viewport-fit=cover" />
    <title>值班长</title>
    <link rel="stylesheet" href="../css/vant.css">
    <link rel="stylesheet" href="css/shareDownPage.css">
</head>

<body>
    <div id="app" v-cloak>
        <div class="shareTit">
            <div>
                <span>中</span>
                <span>肽</span>
                <span>悦</span>
                <span>享</span>
            </div>
            <div>
                <span>超</span>
                <span>值</span>
                <span>每</span>
                <span>日</span>
                <span>生</span>
                <span>活</span>
            </div>
        </div>
        <div class="zbzLogo">
            <img src="../img/about.png" alt="logo">
            <div>
                <span>中肽悦享</span>
                <span>热爱生活的人都来这里</span>
            </div>
        </div>
        <div class="pageMain">
            <img class="topMain" src="../img/sharePage2.png" alt="">
            <img class="bottomMain" src="../img/sharePage1.png" alt="">
        </div>
        <!-- 按钮 -->
        <div class="btn" @click="downHandle">
            立即下载
        </div>
        <div class="downBox" v-if="showPop" @click="showPop=false">
            <img src="./img/downTip.png" alt="">
        </div>
    </div>



    <script src="../js/vue.min.js"></script>
    <script src="../js/flex_ible/lib-flexible.js"></script>
    <script src="../js/vue-lazyload.js"></script>
    <script src="../js/vant.min.js"></script>
    <script src="../js/vue-lazyload.js"></script>
    <script src="../js/url.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/ajax.js"></script>
    <script>
        var ua = navigator.userAgent.toLowerCase();
        var isWeixin = ua.indexOf('micromessenger') != -1;

        console.log(isWeixin);
        Vue.use(VueLazyload);
        var vm = new Vue({
            el: "#app",
            data: {
                showPop: false,
                shopInfo: sessionStorage.getItem('shop') == null ? '' : JSON.parse(sessionStorage.getItem('shop'))
            },
            created() {
                this.shopInfo = {
                    shopName: '测试门店2',
                    shopAddres: '山东省德州市德城区新华街道办事处新园社区新宜家园90.91号',
                    shopTel: '15904440357',
                }
                if (this.shopInfo != '') {
                    this.setTitle(this.shopInfo.shopName)
                }
            },
            methods: {
                setTitle(name) {
                    document.title = name
                    const i = document.createElement('iframe')
                    i.src = '/favicon.ico'
                    i.style.display = 'none'
                    i.onload = function () {
                        setTimeout(function () {
                            i.remove()
                        }, 9)
                    }
                    document.body.appendChild(i)

                },

                downHandle: function () {
                    if (isWeixin) {
                        this.showPop = true
                    } else {
                        if (window.navigator.userAgent.match(/(iPhone|iPod|iPad);?/i)) {
                            console.log("000");
                            var loadDateTime = new Date();
                            window.location = "clinic://"; //schema链接或者universal link
                            window.setTimeout(
                                function () { //如果没有安装app,便会执行setTimeout跳转下载页
                                    var timeOutDateTime = new Date();
                                    if (timeOutDateTime - loadDateTime < 5000) {
                                        window.location =
                                            "https://itunes.apple.com/cn/app/%E5%80%BC%E6%97%A5%E7%94%9F/id1448441059?mt=8"; //ios下载地址  
                                    } else {
                                        window.close();
                                    }
                                }, 500);
                        } else if (window.navigator.userAgent.match(/android/i)) {
                            var state = null;
                            try {
                                window.location = 'clinic://'; //schema链接或者universal link
                                window.setTimeout(
                                    function () {
                                        window.location =
                                            "https://a.app.qq.com/o/simple.jsp?pkgname=com.ccclkj.clinic";
                                        //window.location = "http://www.ccclkj.cn:1125/zbz.apk"; 
                                        //android下载地址  
                                    }, 500);
                            } catch (e) { }
                        }
                    }



                    // window.location.href = ' https://zbz-downlink.oss-cn-zhangjiakou.aliyuncs.com/com.ccclkj.clinic.wgt'
                    // window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx9cf9f21ba0cbf62b&redirect_uri=http://www.ccclkj.cn/zhensuo/sys/firstLoginUserAction.action?shop_id=" + ${this.shopId} + "&response_type=code&scope=snsapi_userinfo&state=" + ${this.userId} + "#wechat_redirect`;
                },

            }
        })
    </script>

</body>

</html>